"""my_project URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, re_path
from hello.views import hello_world, hello_china, hello_html, article_list, search, test_34, render_str, render_html, \
    http_request, http_response, no_data_404, article_detail, HomeView, index, tag, test_filter, mine_filter

urlpatterns = [
    path('world/', hello_world, name='hello_world'),
    path('china/', hello_china, name='hello_china'),
    path('html/', hello_html, name='hello_html'),
    # path('article/<int:month>/', article_list, name='article_list'),
    re_path(r'^article/(?P<month>0?[1-9]|1[012])/$', article_list, name='article_list'),
    path('search/', search, name='search'),
    re_path(r'^test/(?P<num>[1-9]|[1-9][0-9]|100)/$', test_34, name='test_34'),
    path('render/str/', render_str, name='render_str'),
    path('render/html/', render_html, name='render_html'),
    path('http/req/', http_request, name='http_req'),
    path('http/resp/', http_response, name='http_resp'),
    path('404/', no_data_404, name='404'),
    path('article_detail/<int:article_id>/', article_detail, name='article_detail'),

    # 类代码
    path('home/', HomeView.as_view(), name='home'),

    # 模版引擎
    path('index/', index, name='index2'),

    # 模板标签
    path('tag/', tag, name='tag'),
    # 过滤器
    path('test/filter', test_filter, name='test_filter'),
    # 自定义过滤器
    path('mine/filter', mine_filter, name='mine_filter'),


]
